<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Clause: src/ner/src/crfsuite_api.hpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Clause
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Chatopera Language Understanding Service.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_e74e521feb2025350ccc5f3a822146f0.html">ner</a></li><li class="navelem"><a class="el" href="dir_ae64d1ab25d88c9b80de6fb740d18eb8.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">crfsuite_api.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *      CRFsuite C++/SWIG API.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright (c) 2007-2010, Naoaki Okazaki</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Copyright (c) 2019, Modified by Chatopera Inc.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * Redistribution and use in source and binary forms, with or without</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * modification, are permitted provided that the following conditions are met:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *     * Redistributions of source code must retain the above copyright</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> *       notice, this list of conditions and the following disclaimer.</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> *     * Redistributions in binary form must reproduce the above copyright</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *       notice, this list of conditions and the following disclaimer in the</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *       documentation and/or other materials provided with the distribution.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> *     * Neither the names of the authors nor the names of its contributors</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *       may be used to endorse or promote products derived from this</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> *       software without specific prior written permission.</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment"> * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="comment"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#ifndef __CHATOPERA_BOT_CRFSUITE_API_HPP__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define __CHATOPERA_BOT_CRFSUITE_API_HPP__</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &lt;stdexcept&gt;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#ifndef __CRFSUITE_H__</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#ifdef  __cplusplus</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#endif</span><span class="comment">/*__cplusplus*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keyword">struct </span>tag_crfsuite_model;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_model crfsuite_model_t;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">struct </span>tag_crfsuite_data;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_data crfsuite_data_t;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">struct </span>tag_crfsuite_trainer;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_trainer crfsuite_trainer_t;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keyword">struct </span>tag_crfsuite_tagger;</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_tagger crfsuite_tagger_t;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="keyword">struct </span>tag_crfsuite_dictionary;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_dictionary crfsuite_dictionary_t;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="keyword">struct </span>tag_crfsuite_params;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>tag_crfsuite_params crfsuite_params_t;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#ifdef  __cplusplus</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#endif</span><span class="comment">/*__cplusplus*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">#endif</span><span class="comment">/*__CRFSUITE_H__*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacechatopera.html">chatopera</a> {</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<span class="keyword">namespace </span>bot {</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<span class="keyword">namespace </span>crfsuite {</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html">  121</a></span>&#160;<span class="keyword">class </span><a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html">Attribute</a> {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aff24066cf639656901918dec263a2b6f">  124</a></span>&#160;  std::string <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aff24066cf639656901918dec263a2b6f">attr</a>;</div><div class="line"><a name="l00126"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a9577b13192af237c2cf8a50aa7aad802">  126</a></span>&#160;  <span class="keywordtype">double</span> <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a9577b13192af237c2cf8a50aa7aad802">value</a>;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a37ef8769792c92e065605a62f8e7e31f">  131</a></span>&#160;  <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a37ef8769792c92e065605a62f8e7e31f">Attribute</a>() : value(1.) {</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  }</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aa90cbc6b5c243ed94d8c94d3db9dd9b9">  138</a></span>&#160;  <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aa90cbc6b5c243ed94d8c94d3db9dd9b9">Attribute</a>(<span class="keyword">const</span> std::string&amp; name) : attr(name), value(1.) {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;  }</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a611a720d69d38ef3837045d6ab371085">  146</a></span>&#160;  <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a611a720d69d38ef3837045d6ab371085">Attribute</a>(<span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">double</span> val) : attr(name), value(val) {</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;  }</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;  <span class="keywordtype">void</span> Attribute::set_attr(<span class="keyword">const</span> std::string&amp; name) {</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;    attr = name;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  }</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  <span class="keywordtype">void</span> Attribute::set_val(<span class="keyword">const</span> <span class="keywordtype">double</span>&amp; val) {</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    value = val;</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;  }</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;};</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="group__crfsuite__hpp__api__doc.html#ga1e1aaf17a4b48230ffae9abd505ab4d0">  164</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;Attribute&gt; <a class="code" href="group__crfsuite__hpp__api__doc.html#ga1e1aaf17a4b48230ffae9abd505ab4d0">Item</a>;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="group__crfsuite__hpp__api__doc.html#ga34f58d96010025b06e985a6710fbfd05">  169</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;Item&gt;  <a class="code" href="group__crfsuite__hpp__api__doc.html#ga34f58d96010025b06e985a6710fbfd05">ItemSequence</a>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">  174</a></span>&#160;<span class="keyword">typedef</span> std::vector&lt;std::string&gt; <a class="code" href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">StringList</a>;</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">  191</a></span>&#160;<span class="keyword">class </span><a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">Trainer</a> {</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  crfsuite_data_t *data;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  crfsuite_trainer_t *tr;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;  <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">Trainer</a>();</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">Trainer</a>();</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  <span class="keywordtype">void</span> init();</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  <span class="keywordtype">void</span> clear();</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;  <span class="keywordtype">void</span> append(<span class="keyword">const</span> ItemSequence&amp; xseq, <span class="keyword">const</span> StringList&amp; yseq, <span class="keywordtype">int</span> group);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;  <span class="keywordtype">bool</span> select(<span class="keyword">const</span> std::string&amp; algorithm, <span class="keyword">const</span> std::string&amp; type);</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;  crfsuite_data_t* pdata();</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;  <span class="keywordtype">bool</span> read_data(<span class="keyword">const</span> std::string&amp; filepath, <span class="keywordtype">int</span> group = 0);</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;  <span class="keywordtype">int</span> train(<span class="keyword">const</span> std::string&amp; model, <span class="keywordtype">int</span> holdout);</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  StringList params();</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;  <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> std::string&amp; name, <span class="keyword">const</span> std::string&amp; <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a9577b13192af237c2cf8a50aa7aad802">value</a>);</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;  std::string <span class="keyword">get</span>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;  std::string help(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;</div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;  <span class="keyword">virtual</span> <span class="keywordtype">void</span> message(<span class="keyword">const</span> std::string&amp; msg);</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;</div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;  <span class="keyword">static</span> <span class="keywordtype">int</span> __logging_callback(<span class="keywordtype">void</span> *userdata, <span class="keyword">const</span> <span class="keywordtype">char</span> *format, va_list args);</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;};</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;</div><div class="line"><a name="l00325"></a><span class="lineno"><a class="line" href="classchatopera_1_1bot_1_1crfsuite_1_1Tagger.html">  325</a></span>&#160;<span class="keyword">class </span><a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Tagger.html">Tagger</a> {</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;  crfsuite_model_t *model;</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  crfsuite_tagger_t *tagger;</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Tagger.html">Tagger</a>();</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;  <span class="keyword">virtual</span> ~<a class="code" href="classchatopera_1_1bot_1_1crfsuite_1_1Tagger.html">Tagger</a>();</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;  <span class="keywordtype">bool</span> open(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  <span class="keywordtype">void</span> close();</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;  StringList labels();</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;</div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;  StringList tag(<span class="keyword">const</span> ItemSequence&amp; xseq);</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;  <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> ItemSequence&amp; xseq);</div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;  StringList viterbi();</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;  <span class="keywordtype">double</span> probability(<span class="keyword">const</span> StringList&amp; yseq);</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;</div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;  <span class="keywordtype">double</span> marginal(<span class="keyword">const</span> std::string&amp; y, <span class="keyword">const</span> <span class="keywordtype">int</span> t);</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;};</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;std::string <a class="code" href="group__crfsuite__hpp__api__doc.html#gaa8ef1fab26ec65f18b7e34e6edac5ef5">version</a>();</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;} <span class="comment">// namespace crfsuite</span></div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;} <span class="comment">// namespace bot</span></div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;} <span class="comment">// namespace chatopera</span></div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;<span class="preprocessor">#endif</span><span class="comment">/*__CHATOPERA_BOT_CRFSUITE_API_HPP__*/</span><span class="preprocessor"></span></div><div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html">chatopera::bot::crfsuite::Attribute</a></div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:121</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Tagger_html"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Tagger.html">chatopera::bot::crfsuite::Tagger</a></div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:325</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Trainer_html"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Trainer.html">chatopera::bot::crfsuite::Trainer</a></div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:191</div></div>
<div class="ttc" id="group__crfsuite__hpp__api__doc_html_gaf82774957c9896d38894cddd592aa061"><div class="ttname"><a href="group__crfsuite__hpp__api__doc.html#gaf82774957c9896d38894cddd592aa061">chatopera::bot::crfsuite::StringList</a></div><div class="ttdeci">std::vector&lt; std::string &gt; StringList</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:174</div></div>
<div class="ttc" id="group__crfsuite__hpp__api__doc_html_gaa8ef1fab26ec65f18b7e34e6edac5ef5"><div class="ttname"><a href="group__crfsuite__hpp__api__doc.html#gaa8ef1fab26ec65f18b7e34e6edac5ef5">chatopera::bot::crfsuite::version</a></div><div class="ttdeci">std::string version()</div><div class="ttdef"><b>Definition:</b> crfsuite.hpp:672</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html_aa90cbc6b5c243ed94d8c94d3db9dd9b9"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aa90cbc6b5c243ed94d8c94d3db9dd9b9">chatopera::bot::crfsuite::Attribute::Attribute</a></div><div class="ttdeci">Attribute(const std::string &amp;name)</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:138</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html_a9577b13192af237c2cf8a50aa7aad802"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a9577b13192af237c2cf8a50aa7aad802">chatopera::bot::crfsuite::Attribute::value</a></div><div class="ttdeci">double value</div><div class="ttdoc">Attribute value (weight). </div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:126</div></div>
<div class="ttc" id="group__crfsuite__hpp__api__doc_html_ga1e1aaf17a4b48230ffae9abd505ab4d0"><div class="ttname"><a href="group__crfsuite__hpp__api__doc.html#ga1e1aaf17a4b48230ffae9abd505ab4d0">chatopera::bot::crfsuite::Item</a></div><div class="ttdeci">std::vector&lt; Attribute &gt; Item</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:164</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html_a611a720d69d38ef3837045d6ab371085"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a611a720d69d38ef3837045d6ab371085">chatopera::bot::crfsuite::Attribute::Attribute</a></div><div class="ttdeci">Attribute(const std::string &amp;name, double val)</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:146</div></div>
<div class="ttc" id="group__crfsuite__hpp__api__doc_html_ga34f58d96010025b06e985a6710fbfd05"><div class="ttname"><a href="group__crfsuite__hpp__api__doc.html#ga34f58d96010025b06e985a6710fbfd05">chatopera::bot::crfsuite::ItemSequence</a></div><div class="ttdeci">std::vector&lt; Item &gt; ItemSequence</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:169</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html_a37ef8769792c92e065605a62f8e7e31f"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#a37ef8769792c92e065605a62f8e7e31f">chatopera::bot::crfsuite::Attribute::Attribute</a></div><div class="ttdeci">Attribute()</div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:131</div></div>
<div class="ttc" id="namespacechatopera_html"><div class="ttname"><a href="namespacechatopera.html">chatopera</a></div><div class="ttdef"><b>Definition:</b> activemq.cpp:14</div></div>
<div class="ttc" id="classchatopera_1_1bot_1_1crfsuite_1_1Attribute_html_aff24066cf639656901918dec263a2b6f"><div class="ttname"><a href="classchatopera_1_1bot_1_1crfsuite_1_1Attribute.html#aff24066cf639656901918dec263a2b6f">chatopera::bot::crfsuite::Attribute::attr</a></div><div class="ttdeci">std::string attr</div><div class="ttdoc">Attribute. </div><div class="ttdef"><b>Definition:</b> crfsuite_api.hpp:124</div></div>
</div><!-- fragment --></div><!-- contents -->
<address class="footer">
    <small>
        &nbsp; Copyright (c) (2019-2020) &nbsp;<a href="https://www.chatopera.com">
            北京华夏春松科技有限公司
        </a>. All Rights Reserved
        &nbsp;
    </small>
</address>